import type { AuditLogVO, AuditLogForm, AuditLogQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询文档审核日志列表
* @param params
* @returns 文档审核日志列表
*/
export function auditLogList(params?: AuditLogQuery) {
  return requestClient.get<PageResult<AuditLogVO>>('/aibox/auditLog/list', { params });
}

/**
 * 导出文档审核日志列表
 * @param params
 * @returns 文档审核日志列表
 */
export function auditLogExport(params?: AuditLogQuery) {
  return commonExport('/aibox/auditLog/export', params ?? {});
}

/**
 * 查询文档审核日志详情
 * @param logId id
 * @returns 文档审核日志详情
 */
export function auditLogInfo(logId: ID) {
  return requestClient.get<AuditLogVO>(`/aibox/auditLog/${logId}`);
}

/**
 * 新增文档审核日志
 * @param data
 * @returns void
 */
export function auditLogAdd(data: AuditLogForm) {
  return requestClient.postWithMsg<void>('/aibox/auditLog', data);
}

/**
 * 更新文档审核日志
 * @param data
 * @returns void
 */
export function auditLogUpdate(data: AuditLogForm) {
  return requestClient.putWithMsg<void>('/aibox/auditLog', data);
}

/**
 * 删除文档审核日志
 * @param logId id
 * @returns void
 */
export function auditLogRemove(logId: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/aibox/auditLog/${logId}`);
}
